#include <iostream>
#include <iomanip>
#include <stdlib.h>
using namespace std;

const double Kr = 10.0;
const double Km = 10.0;
const double Kp = 10.0;
const double gm = 1.0;
const double gp = 1.0;

long double G = 1;
long double M = 0;
long double P = 0;

void step (double);

void step(double h) {

	double dG = 0;
	long double dM = Km*G - gm*M;
	long double dP = Kp*M - gp*P;

	G += h*dG;
	M += h*dM;
	P += h*dP;
}

void print(double time) {
	
	cout << setw(6) <<  setprecision (2) << time << " G = ";
	cout << setw(3) <<  setprecision (2) << G << " M = ";
	cout << setw(11) <<  setprecision (9) << M << " P = ";
	cout << setw(11) <<  setprecision (9) << P << endl;

}

int main(int argc, char *argv[]){

	double stepsize = strtod(argv[1],NULL);
	double time = 0.0;

	cout << fixed << setiosflags (ios::right);

	for(int i=0; i<300; i++) {
	    print(time);
	    step(stepsize);
	    time += stepsize;
	}
}
